home *** CD-ROM | disk | FTP | other *** search
- From: Phil Nelson <phil@cs.wwu.edu>
- Subject: v01i069: GNU_bc - numeric processing language, Patch01
- Newsgroups: comp.sources.reviewed
- Approved: csr@calvin.dgbt.doc.ca
-
- Submitted-by: Phil Nelson <phil@cs.wwu.edu>
- Posting-number: Volume 1, Issue 69
- Archive-name: GNU_bc/patch01
- Patch-To: GNU_bc: Volume 1, Issue 41-48
-
- Here is patch 1 for GNU_bc. This patch brings GNU_bc to version 1.02.
-
- This is patch contains mainly bug fixes. It is recommended that people
- use the supplied flex scanner. (Via "make derived" before the full
- make.) The most recent version of flex has a bug that hangs the scanner
- if the NUL character is input.
-
- For a complete list of changes, see the ChangeLog after applying the
- patch.
-
-
-
- diff -c2 -r 1.01/ChangeLog 1.02/ChangeLog
- *** 1.01/ChangeLog Thu Feb 6 16:45:19 1992
- --- 1.02/ChangeLog Tue Mar 3 10:29:20 1992
- ***************
- *** 1,2 ****
- --- 1,68 ----
- + Tue Mar 3 10:16:07 1992 Phil Nelson (phil at cs.wwu.edu)
- +
- + * (main.c) Added missing } at line 140.
- +
- + * (version.h) Changed date of version 1.02 to March 3, 1992.
- +
- + Mon Feb 3 16:07:57 1992 Phil Nelson (phil at cs.wwu.edu)
- +
- + * (version.h) Updated version number and date.
- +
- + * (bc.1) Added a new "VERSION" section.
- +
- + Wed Jan 29 14:13:55 1992 Phil Nelson (phil at cs.wwu.edu)
- +
- + * (execute.c) Removed the setjmp and longjmp calls that may have
- + caused some problems with interrupted programs.
- +
- + Thu Jan 16 17:08:16 1992 Phil Nelson (phil at cs.wwu.edu)
- +
- + * (Makefile) Changed install to install the manual.
- +
- + Wed Jan 8 13:23:42 1992 Phil Nelson (phil at cs.wwu.edu)
- +
- + * Change all copyright notices to include 1992.
- +
- + * (load.c) Added termination to "load_code" to ignore code
- + after an error has been found.
- +
- + * (scan.l) Changed the check for NUL characters in STRING tokens
- + (before the close quote) to work correctly. Also added code to
- + report illegal characters in a more readable output format.
- +
- + * (bc.1) Added the exclusion of NUL characters from strings in
- + the "differences" section and updated date of last change.
- +
- + * (const.h) Changed BC_MAX_SEGS to 16.
- +
- + Mon Jan 6 14:20:02 1992 Phil Nelson (phil at cs.wwu.edu)
- +
- + * (number.c) Changed the out_num routine to use a correct field
- + size for bases greater than 16. e.g. For base 1000, each
- + "digit" is a three digit number.
- +
- + * (Makefile) Added the "8" flag to get an 8 bit scanner.
- +
- + * (scan.l) Changed "char *" to "unsigned char *" to match the
- + declaration of yytext for the 8 bit scanner. Also added code
- + to detect the null character in strings and generate an error.
- +
- + Sat Jan 4 20:32:20 1992 Phil Nelson (phil at cs.wwu.edu)
- +
- + * (const.h) Changed BC_BASE_MAX to INT_MAX to allow more bases!
- +
- + Mon Dec 30 21:47:28 1991 Phil Nelson (phil at cs.wwu.edu)
- +
- + * (main.c) Fixed the bug that loaded the math library before
- + every file.
- +
- + * (bc.y) Removed some type declarations that duplicated token
- + definitions so it could be run through bison.
- +
- + * (load.c) Added a check for maximum code size.
- +
- + * (Makefile) Added a prefix for LIBDIR and BINDIR so it can be
- + changed easily.
- +
- Mon Nov 25 13:11:17 1991 Phil Nelson (phil at cs.wwu.edu)
-
- Common subdirectories: 1.01/Examples and 1.02/Examples
- diff -c2 -r 1.01/MANIFEST 1.02/MANIFEST
- *** 1.01/MANIFEST Thu Feb 6 16:45:20 1992
- --- 1.02/MANIFEST Tue Mar 3 10:29:22 1992
- ***************
- *** 45,49 ****
- sbc.y 2
- scan.c.dist 6
- ! scan.l 1
- storage.c 4
- util.c 3
- --- 45,49 ----
- sbc.y 2
- scan.c.dist 6
- ! scan.l 2
- storage.c 4
- util.c 3
- diff -c2 -r 1.01/Makefile 1.02/Makefile
- *** 1.01/Makefile Thu Feb 6 16:45:21 1992
- --- 1.02/Makefile Tue Mar 3 10:29:23 1992
- ***************
- *** 7,12 ****
- # LIBDIR and BINDIR are where bc and libmath.b will be put.
- #
- ! LIBDIR = /usr/local/lib
- ! BINDIR = /usr/local/bin
- #
- # INCLUDE is the directory from where header files are included.
- --- 7,14 ----
- # LIBDIR and BINDIR are where bc and libmath.b will be put.
- #
- ! PREFIX = /usr/local
- ! LIBDIR = $(PREFIX)/lib
- ! BINDIR = $(PREFIX)/bin
- ! MANDIR = $(PREFIX)/man/man1
- #
- # INCLUDE is the directory from where header files are included.
- ***************
- *** 23,27 ****
- SHELL = /bin/sh
- YACC = yacc
- ! LEX = flex -I
- #LEX = lex
- CC = cc
- --- 25,30 ----
- SHELL = /bin/sh
- YACC = yacc
- ! #YACC = bison -y
- ! LEX = flex -I8
- #LEX = lex
- CC = cc
- ***************
- *** 65,69 ****
-
- all: bc
- ! bc: config.h bc.$O $(OFILES) global.$O
- $(CC) -o bc $(LDFLAGS) bc.$O $(OFILES) global.$O
-
- --- 68,72 ----
-
- all: bc
- ! bc: $& config.h bc.$O $(OFILES) global.$O
- $(CC) -o bc $(LDFLAGS) bc.$O $(OFILES) global.$O
-
- ***************
- *** 91,94 ****
- --- 94,98 ----
- if grep -s BC_MATH_FILE config.h; then rm -f $(LIBDIR)/libmath.b; \
- cp libmath.b $(LIBDIR); chmod 444 $(LIBDIR)/libmath.b; else true; fi
- + cp bc.1 $(MANDIR)
-
- dist: $(EXTRAFILES)
- Common subdirectories: 1.01/Test and 1.02/Test
- diff -c2 -r 1.01/bc.1 1.02/bc.1
- *** 1.01/bc.1 Thu Feb 6 16:45:40 1992
- --- 1.02/bc.1 Tue Mar 3 10:29:43 1992
- ***************
- *** 3,7 ****
- .\"
- .\" This file is part of bc written for MINIX.
- ! .\" Copyright (C) 1991 Free Software Foundation, Inc.
- .\"
- .\" This program is free software; you can redistribute it and/or modify
- --- 3,7 ----
- .\"
- .\" This file is part of bc written for MINIX.
- ! .\" Copyright (C) 1991, 1992 Free Software Foundation, Inc.
- .\"
- .\" This program is free software; you can redistribute it and/or modify
- ***************
- *** 27,31 ****
- .\"
- .\"
- ! .TH bc 1 .\" "Command Manual" v1.01 "Nov 22, 1991"
- .SH NAME
- bc - An arbitrary precision calculator language
- --- 27,31 ----
- .\"
- .\"
- ! .TH bc 1 .\" "Command Manual" v1.02 "Feb 3, 1992"
- .SH NAME
- bc - An arbitrary precision calculator language
- ***************
- *** 32,35 ****
- --- 32,37 ----
- .SH SYNTAX
- \fBbc\fR [ \fB-lws\fR ] [ \fI file ...\fR ]
- + .SH VERSION
- + This man page documents GNU bc version 1.02.
- .SH DESCRIPTION
- \fBbc\fR is a language that supports arbitrary precision numbers
- ***************
- *** 589,593 ****
- A major source of differences is
- extensions, where a feature is extended to add more functionality and
- ! additions, where new features are added.
- The following is the list of differences and extensions.
- .IP LANG environment
- --- 591,595 ----
- A major source of differences is
- extensions, where a feature is extended to add more functionality and
- ! additions, where new features are added.
- The following is the list of differences and extensions.
- .IP LANG environment
- ***************
- *** 601,604 ****
- --- 603,609 ----
- been extended to be multi-character names that start with a letter and
- may contain letters, numbers and the underscore character.
- + .IP Strings
- + Strings are not allowed to contain NUL characters. POSIX says all characters
- + must be included in strings.
- .IP last
- POSIX \fBbc\fR does not have a \fBlast\fR variable. Some implementations
- ***************
- *** 661,664 ****
- --- 666,681 ----
- of the current execution block. A runtime warning will not terminate the
- current execution block.
- + .IP "Interrupts"
- + During an interactive session, the SIGINT signal (usually generated by
- + the control-C character from the terminal) will cause execution of the
- + current execution block to be interrupted. It will display a "runtime"
- + error indicating which function was interrupted. After all runtime
- + structures have been cleaned up, a message will be printed to notify the
- + user that \fBbc\fR is ready for more input. All previously defined functions
- + remain defined and the value of all non-auto variables are the value at
- + the point of interruption. All auto variables and function parameters
- + are removed during the
- + clean up process. During a non-interactive
- + session, the SIGINT signal will terminate the entire run of \fBbc\fR.
- .SS LIMITS
- The following are the limits currently in place for this
- diff -c2 -r 1.01/bc.c.dist 1.02/bc.c.dist
- *** 1.01/bc.c.dist Thu Feb 6 16:45:45 1992
- --- 1.02/bc.c.dist Tue Mar 3 10:29:48 1992
- ***************
- *** 8,12 ****
-
- /* This file is part of bc written for MINIX.
- ! Copyright (C) 1991 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- --- 8,12 ----
-
- /* This file is part of bc written for MINIX.
- ! Copyright (C) 1991, 1992 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- ***************
- *** 685,689 ****
- {
- case 1:
- ! #line 108 "bc.y"
- {
- yyval.i_value = 0;
- --- 685,689 ----
- {
- case 1:
- ! #line 106 "bc.y"
- {
- yyval.i_value = 0;
- ***************
- *** 696,708 ****
- break;
- case 3:
- ! #line 119 "bc.y"
- { run_code (); }
- break;
- case 4:
- ! #line 121 "bc.y"
- { run_code (); }
- break;
- case 5:
- ! #line 123 "bc.y"
- {
- yyerrok;
- --- 696,708 ----
- break;
- case 3:
- ! #line 117 "bc.y"
- { run_code (); }
- break;
- case 4:
- ! #line 119 "bc.y"
- { run_code (); }
- break;
- case 5:
- ! #line 121 "bc.y"
- {
- yyerrok;
- ***************
- *** 711,735 ****
- break;
- case 6:
- ! #line 129 "bc.y"
- { yyval.i_value = 0; }
- break;
- case 10:
- ! #line 135 "bc.y"
- { yyval.i_value = 0; }
- break;
- case 17:
- ! #line 144 "bc.y"
- { yyval.i_value = yyvsp[0].i_value; }
- break;
- case 18:
- ! #line 147 "bc.y"
- { warranty (""); }
- break;
- case 19:
- ! #line 149 "bc.y"
- { limits (); }
- break;
- case 20:
- ! #line 151 "bc.y"
- {
- if (yyvsp[0].i_value & 2)
- --- 711,735 ----
- break;
- case 6:
- ! #line 127 "bc.y"
- { yyval.i_value = 0; }
- break;
- case 10:
- ! #line 133 "bc.y"
- { yyval.i_value = 0; }
- break;
- case 17:
- ! #line 142 "bc.y"
- { yyval.i_value = yyvsp[0].i_value; }
- break;
- case 18:
- ! #line 145 "bc.y"
- { warranty (""); }
- break;
- case 19:
- ! #line 147 "bc.y"
- { limits (); }
- break;
- case 20:
- ! #line 149 "bc.y"
- {
- if (yyvsp[0].i_value & 2)
- ***************
- *** 742,746 ****
- break;
- case 21:
- ! #line 160 "bc.y"
- {
- yyval.i_value = 0;
- --- 742,746 ----
- break;
- case 21:
- ! #line 158 "bc.y"
- {
- yyval.i_value = 0;
- ***************
- *** 751,755 ****
- break;
- case 22:
- ! #line 167 "bc.y"
- {
- if (break_label == 0)
- --- 751,755 ----
- break;
- case 22:
- ! #line 165 "bc.y"
- {
- if (break_label == 0)
- ***************
- *** 763,767 ****
- break;
- case 23:
- ! #line 177 "bc.y"
- {
- warn ("Continue statement");
- --- 763,767 ----
- break;
- case 23:
- ! #line 175 "bc.y"
- {
- warn ("Continue statement");
- ***************
- *** 776,796 ****
- break;
- case 24:
- ! #line 188 "bc.y"
- { exit (0); }
- break;
- case 25:
- ! #line 190 "bc.y"
- { generate ("h"); }
- break;
- case 26:
- ! #line 192 "bc.y"
- { generate ("0R"); }
- break;
- case 27:
- ! #line 194 "bc.y"
- { generate ("R"); }
- break;
- case 28:
- ! #line 196 "bc.y"
- {
- yyvsp[0].i_value = break_label;
- --- 776,796 ----
- break;
- case 24:
- ! #line 186 "bc.y"
- { exit (0); }
- break;
- case 25:
- ! #line 188 "bc.y"
- { generate ("h"); }
- break;
- case 26:
- ! #line 190 "bc.y"
- { generate ("0R"); }
- break;
- case 27:
- ! #line 192 "bc.y"
- { generate ("R"); }
- break;
- case 28:
- ! #line 194 "bc.y"
- {
- yyvsp[0].i_value = break_label;
- ***************
- *** 799,803 ****
- break;
- case 29:
- ! #line 201 "bc.y"
- {
- if (yyvsp[-1].i_value > 1)
- --- 799,803 ----
- break;
- case 29:
- ! #line 199 "bc.y"
- {
- if (yyvsp[-1].i_value > 1)
- ***************
- *** 812,816 ****
- break;
- case 30:
- ! #line 212 "bc.y"
- {
- if (yyvsp[-1].i_value < 0) generate ("1");
- --- 812,816 ----
- break;
- case 30:
- ! #line 210 "bc.y"
- {
- if (yyvsp[-1].i_value < 0) generate ("1");
- ***************
- *** 825,829 ****
- break;
- case 31:
- ! #line 223 "bc.y"
- {
- if (yyvsp[-1].i_value > 1)
- --- 825,829 ----
- break;
- case 31:
- ! #line 221 "bc.y"
- {
- if (yyvsp[-1].i_value > 1)
- ***************
- *** 837,841 ****
- break;
- case 32:
- ! #line 233 "bc.y"
- {
- sprintf (genstr, "J%1d:N%1d:",
- --- 837,841 ----
- break;
- case 32:
- ! #line 231 "bc.y"
- {
- sprintf (genstr, "J%1d:N%1d:",
- ***************
- *** 847,851 ****
- break;
- case 33:
- ! #line 241 "bc.y"
- {
- yyvsp[-1].i_value = if_label;
- --- 847,851 ----
- break;
- case 33:
- ! #line 239 "bc.y"
- {
- yyvsp[-1].i_value = if_label;
- ***************
- *** 856,860 ****
- break;
- case 34:
- ! #line 248 "bc.y"
- {
- sprintf (genstr, "N%1d:", if_label);
- --- 856,860 ----
- break;
- case 34:
- ! #line 246 "bc.y"
- {
- sprintf (genstr, "N%1d:", if_label);
- ***************
- *** 864,868 ****
- break;
- case 35:
- ! #line 254 "bc.y"
- {
- yyvsp[0].i_value = next_label++;
- --- 864,868 ----
- break;
- case 35:
- ! #line 252 "bc.y"
- {
- yyvsp[0].i_value = next_label++;
- ***************
- *** 872,876 ****
- break;
- case 36:
- ! #line 260 "bc.y"
- {
- yyvsp[0].i_value = break_label;
- --- 872,876 ----
- break;
- case 36:
- ! #line 258 "bc.y"
- {
- yyvsp[0].i_value = break_label;
- ***************
- *** 881,885 ****
- break;
- case 37:
- ! #line 267 "bc.y"
- {
- sprintf (genstr, "J%1d:N%1d:", yyvsp[-6].i_value, break_label);
- --- 881,885 ----
- break;
- case 37:
- ! #line 265 "bc.y"
- {
- sprintf (genstr, "J%1d:N%1d:", yyvsp[-6].i_value, break_label);
- ***************
- *** 889,901 ****
- break;
- case 38:
- ! #line 273 "bc.y"
- { yyval.i_value = 0; }
- break;
- case 39:
- ! #line 275 "bc.y"
- { warn ("print statement"); }
- break;
- case 43:
- ! #line 282 "bc.y"
- {
- generate ("O");
- --- 889,901 ----
- break;
- case 38:
- ! #line 271 "bc.y"
- { yyval.i_value = 0; }
- break;
- case 39:
- ! #line 273 "bc.y"
- { warn ("print statement"); }
- break;
- case 43:
- ! #line 280 "bc.y"
- {
- generate ("O");
- ***************
- *** 905,913 ****
- break;
- case 44:
- ! #line 288 "bc.y"
- { generate ("P"); }
- break;
- case 46:
- ! #line 292 "bc.y"
- {
- warn ("else clause in if statement");
- --- 905,913 ----
- break;
- case 44:
- ! #line 286 "bc.y"
- { generate ("P"); }
- break;
- case 46:
- ! #line 290 "bc.y"
- {
- warn ("else clause in if statement");
- ***************
- *** 919,923 ****
- break;
- case 48:
- ! #line 302 "bc.y"
- {
- /* Check auto list against parameter list? */
- --- 919,923 ----
- break;
- case 48:
- ! #line 300 "bc.y"
- {
- /* Check auto list against parameter list? */
- ***************
- *** 933,937 ****
- break;
- case 49:
- ! #line 314 "bc.y"
- {
- generate ("0R]");
- --- 933,937 ----
- break;
- case 49:
- ! #line 312 "bc.y"
- {
- generate ("0R]");
- ***************
- *** 940,980 ****
- break;
- case 50:
- ! #line 320 "bc.y"
- { yyval.a_value = NULL; }
- break;
- case 52:
- ! #line 324 "bc.y"
- { yyval.a_value = NULL; }
- break;
- case 53:
- ! #line 326 "bc.y"
- { yyval.a_value = yyvsp[-1].a_value; }
- break;
- case 54:
- ! #line 328 "bc.y"
- { yyval.a_value = yyvsp[-1].a_value; }
- break;
- case 55:
- ! #line 331 "bc.y"
- { yyval.a_value = nextarg (NULL, lookup (yyvsp[0].s_value,SIMPLE)); }
- break;
- case 56:
- ! #line 333 "bc.y"
- { yyval.a_value = nextarg (NULL, lookup (yyvsp[-2].s_value,ARRAY)); }
- break;
- case 57:
- ! #line 335 "bc.y"
- { yyval.a_value = nextarg (yyvsp[-2].a_value, lookup (yyvsp[0].s_value,SIMPLE)); }
- break;
- case 58:
- ! #line 337 "bc.y"
- { yyval.a_value = nextarg (yyvsp[-4].a_value, lookup (yyvsp[-2].s_value,ARRAY)); }
- break;
- case 59:
- ! #line 340 "bc.y"
- { yyval.a_value = NULL; }
- break;
- case 61:
- ! #line 344 "bc.y"
- {
- if (yyvsp[0].i_value > 1) warn ("comparison in argument");
- --- 940,980 ----
- break;
- case 50:
- ! #line 318 "bc.y"
- { yyval.a_value = NULL; }
- break;
- case 52:
- ! #line 322 "bc.y"
- { yyval.a_value = NULL; }
- break;
- case 53:
- ! #line 324 "bc.y"
- { yyval.a_value = yyvsp[-1].a_value; }
- break;
- case 54:
- ! #line 326 "bc.y"
- { yyval.a_value = yyvsp[-1].a_value; }
- break;
- case 55:
- ! #line 329 "bc.y"
- { yyval.a_value = nextarg (NULL, lookup (yyvsp[0].s_value,SIMPLE)); }
- break;
- case 56:
- ! #line 331 "bc.y"
- { yyval.a_value = nextarg (NULL, lookup (yyvsp[-2].s_value,ARRAY)); }
- break;
- case 57:
- ! #line 333 "bc.y"
- { yyval.a_value = nextarg (yyvsp[-2].a_value, lookup (yyvsp[0].s_value,SIMPLE)); }
- break;
- case 58:
- ! #line 335 "bc.y"
- { yyval.a_value = nextarg (yyvsp[-4].a_value, lookup (yyvsp[-2].s_value,ARRAY)); }
- break;
- case 59:
- ! #line 338 "bc.y"
- { yyval.a_value = NULL; }
- break;
- case 61:
- ! #line 342 "bc.y"
- {
- if (yyvsp[0].i_value > 1) warn ("comparison in argument");
- ***************
- *** 983,987 ****
- break;
- case 62:
- ! #line 349 "bc.y"
- {
- sprintf (genstr, "K%d:", -lookup (yyvsp[-2].s_value,ARRAY));
- --- 983,987 ----
- break;
- case 62:
- ! #line 347 "bc.y"
- {
- sprintf (genstr, "K%d:", -lookup (yyvsp[-2].s_value,ARRAY));
- ***************
- *** 991,995 ****
- break;
- case 63:
- ! #line 355 "bc.y"
- {
- if (yyvsp[0].i_value > 1) warn ("comparison in argument");
- --- 991,995 ----
- break;
- case 63:
- ! #line 353 "bc.y"
- {
- if (yyvsp[0].i_value > 1) warn ("comparison in argument");
- ***************
- *** 998,1002 ****
- break;
- case 64:
- ! #line 360 "bc.y"
- {
- sprintf (genstr, "K%d:", -lookup (yyvsp[-2].s_value,ARRAY));
- --- 998,1002 ----
- break;
- case 64:
- ! #line 358 "bc.y"
- {
- sprintf (genstr, "K%d:", -lookup (yyvsp[-2].s_value,ARRAY));
- ***************
- *** 1006,1010 ****
- break;
- case 65:
- ! #line 367 "bc.y"
- {
- yyval.i_value = -1;
- --- 1006,1010 ----
- break;
- case 65:
- ! #line 365 "bc.y"
- {
- yyval.i_value = -1;
- ***************
- *** 1013,1017 ****
- break;
- case 67:
- ! #line 374 "bc.y"
- {
- yyval.i_value = 0;
- --- 1013,1017 ----
- break;
- case 67:
- ! #line 372 "bc.y"
- {
- yyval.i_value = 0;
- ***************
- *** 1020,1024 ****
- break;
- case 68:
- ! #line 379 "bc.y"
- {
- if (yyvsp[0].i_value > 1)
- --- 1020,1024 ----
- break;
- case 68:
- ! #line 377 "bc.y"
- {
- if (yyvsp[0].i_value > 1)
- ***************
- *** 1027,1031 ****
- break;
- case 69:
- ! #line 385 "bc.y"
- {
- if (yyvsp[0].c_value != '=')
- --- 1027,1031 ----
- break;
- case 69:
- ! #line 383 "bc.y"
- {
- if (yyvsp[0].c_value != '=')
- ***************
- *** 1040,1044 ****
- break;
- case 70:
- ! #line 396 "bc.y"
- {
- if (yyvsp[0].i_value > 1) warn("comparison in assignment");
- --- 1040,1044 ----
- break;
- case 70:
- ! #line 394 "bc.y"
- {
- if (yyvsp[0].i_value > 1) warn("comparison in assignment");
- ***************
- *** 1057,1061 ****
- break;
- case 71:
- ! #line 412 "bc.y"
- {
- warn("&& operator");
- --- 1057,1061 ----
- break;
- case 71:
- ! #line 410 "bc.y"
- {
- warn("&& operator");
- ***************
- *** 1066,1070 ****
- break;
- case 72:
- ! #line 419 "bc.y"
- {
- sprintf (genstr, "DZ%d:p1N%d:", yyvsp[-2].i_value, yyvsp[-2].i_value);
- --- 1066,1070 ----
- break;
- case 72:
- ! #line 417 "bc.y"
- {
- sprintf (genstr, "DZ%d:p1N%d:", yyvsp[-2].i_value, yyvsp[-2].i_value);
- ***************
- *** 1074,1078 ****
- break;
- case 73:
- ! #line 425 "bc.y"
- {
- warn("|| operator");
- --- 1074,1078 ----
- break;
- case 73:
- ! #line 423 "bc.y"
- {
- warn("|| operator");
- ***************
- *** 1083,1087 ****
- break;
- case 74:
- ! #line 432 "bc.y"
- {
- int tmplab;
- --- 1083,1087 ----
- break;
- case 74:
- ! #line 430 "bc.y"
- {
- int tmplab;
- ***************
- *** 1094,1098 ****
- break;
- case 75:
- ! #line 441 "bc.y"
- {
- yyval.i_value = yyvsp[0].i_value;
- --- 1094,1098 ----
- break;
- case 75:
- ! #line 439 "bc.y"
- {
- yyval.i_value = yyvsp[0].i_value;
- ***************
- *** 1102,1106 ****
- break;
- case 76:
- ! #line 447 "bc.y"
- {
- yyval.i_value = 3;
- --- 1102,1106 ----
- break;
- case 76:
- ! #line 445 "bc.y"
- {
- yyval.i_value = 3;
- ***************
- *** 1132,1136 ****
- break;
- case 77:
- ! #line 475 "bc.y"
- {
- generate ("+");
- --- 1132,1136 ----
- break;
- case 77:
- ! #line 473 "bc.y"
- {
- generate ("+");
- ***************
- *** 1139,1143 ****
- break;
- case 78:
- ! #line 480 "bc.y"
- {
- generate ("-");
- --- 1139,1143 ----
- break;
- case 78:
- ! #line 478 "bc.y"
- {
- generate ("-");
- ***************
- *** 1146,1150 ****
- break;
- case 79:
- ! #line 485 "bc.y"
- {
- genstr[0] = yyvsp[-1].c_value;
- --- 1146,1150 ----
- break;
- case 79:
- ! #line 483 "bc.y"
- {
- genstr[0] = yyvsp[-1].c_value;
- ***************
- *** 1155,1159 ****
- break;
- case 80:
- ! #line 492 "bc.y"
- {
- generate ("^");
- --- 1155,1159 ----
- break;
- case 80:
- ! #line 490 "bc.y"
- {
- generate ("^");
- ***************
- *** 1162,1166 ****
- break;
- case 81:
- ! #line 497 "bc.y"
- {
- generate ("n");
- --- 1162,1166 ----
- break;
- case 81:
- ! #line 495 "bc.y"
- {
- generate ("n");
- ***************
- *** 1169,1173 ****
- break;
- case 82:
- ! #line 502 "bc.y"
- {
- yyval.i_value = 1;
- --- 1169,1173 ----
- break;
- case 82:
- ! #line 500 "bc.y"
- {
- yyval.i_value = 1;
- ***************
- *** 1180,1184 ****
- break;
- case 83:
- ! #line 511 "bc.y"
- {
- int len = strlen(yyvsp[0].s_value);
- --- 1180,1184 ----
- break;
- case 83:
- ! #line 509 "bc.y"
- {
- int len = strlen(yyvsp[0].s_value);
- ***************
- *** 1198,1206 ****
- break;
- case 84:
- ! #line 527 "bc.y"
- { yyval.i_value = yyvsp[-1].i_value | 1; }
- break;
- case 85:
- ! #line 529 "bc.y"
- {
- yyval.i_value = 1;
- --- 1198,1206 ----
- break;
- case 84:
- ! #line 525 "bc.y"
- { yyval.i_value = yyvsp[-1].i_value | 1; }
- break;
- case 85:
- ! #line 527 "bc.y"
- {
- yyval.i_value = 1;
- ***************
- *** 1220,1224 ****
- break;
- case 86:
- ! #line 545 "bc.y"
- {
- yyval.i_value = 1;
- --- 1220,1224 ----
- break;
- case 86:
- ! #line 543 "bc.y"
- {
- yyval.i_value = 1;
- ***************
- *** 1241,1245 ****
- break;
- case 87:
- ! #line 564 "bc.y"
- {
- yyval.i_value = 1;
- --- 1241,1245 ----
- break;
- case 87:
- ! #line 562 "bc.y"
- {
- yyval.i_value = 1;
- ***************
- *** 1266,1282 ****
- break;
- case 88:
- ! #line 587 "bc.y"
- { generate ("cL"); yyval.i_value = 1;}
- break;
- case 89:
- ! #line 589 "bc.y"
- { generate ("cR"); yyval.i_value = 1;}
- break;
- case 90:
- ! #line 591 "bc.y"
- { generate ("cS"); yyval.i_value = 1;}
- break;
- case 91:
- ! #line 593 "bc.y"
- {
- warn ("read function");
- --- 1266,1282 ----
- break;
- case 88:
- ! #line 585 "bc.y"
- { generate ("cL"); yyval.i_value = 1;}
- break;
- case 89:
- ! #line 587 "bc.y"
- { generate ("cR"); yyval.i_value = 1;}
- break;
- case 90:
- ! #line 589 "bc.y"
- { generate ("cS"); yyval.i_value = 1;}
- break;
- case 91:
- ! #line 591 "bc.y"
- {
- warn ("read function");
- ***************
- *** 1285,1293 ****
- break;
- case 92:
- ! #line 599 "bc.y"
- { yyval.i_value = lookup(yyvsp[0].s_value,SIMPLE); }
- break;
- case 93:
- ! #line 601 "bc.y"
- {
- if (yyvsp[-1].i_value > 1) warn("comparison in subscript");
- --- 1285,1293 ----
- break;
- case 92:
- ! #line 597 "bc.y"
- { yyval.i_value = lookup(yyvsp[0].s_value,SIMPLE); }
- break;
- case 93:
- ! #line 599 "bc.y"
- {
- if (yyvsp[-1].i_value > 1) warn("comparison in subscript");
- ***************
- *** 1296,1312 ****
- break;
- case 94:
- ! #line 606 "bc.y"
- { yyval.i_value = 0; }
- break;
- case 95:
- ! #line 608 "bc.y"
- { yyval.i_value = 1; }
- break;
- case 96:
- ! #line 610 "bc.y"
- { yyval.i_value = 2; }
- break;
- case 97:
- ! #line 612 "bc.y"
- { yyval.i_value = 3; }
- break;
- --- 1296,1312 ----
- break;
- case 94:
- ! #line 604 "bc.y"
- { yyval.i_value = 0; }
- break;
- case 95:
- ! #line 606 "bc.y"
- { yyval.i_value = 1; }
- break;
- case 96:
- ! #line 608 "bc.y"
- { yyval.i_value = 2; }
- break;
- case 97:
- ! #line 610 "bc.y"
- { yyval.i_value = 3; }
- break;
- diff -c2 -r 1.01/bc.y 1.02/bc.y
- *** 1.01/bc.y Thu Feb 6 16:45:33 1992
- --- 1.02/bc.y Tue Mar 3 10:29:36 1992
- ***************
- *** 4,8 ****
-
- /* This file is part of bc written for MINIX.
- ! Copyright (C) 1991 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- --- 4,8 ----
-
- /* This file is part of bc written for MINIX.
- ! Copyright (C) 1991, 1992 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- ***************
- *** 87,94 ****
- %type <a_value> opt_parameter_list opt_auto_define_list define_list
- %type <a_value> opt_argument_list argument_list
- - %type <s_value> NAME STRING NUMBER
- %type <i_value> program input_item semicolon_list statement_list
- %type <i_value> statement function statement_or_error
- - %type <i_value> NEWLINE AND OR NOT
-
- /* precedence */
- --- 87,92 ----
- diff -c2 -r 1.01/bcdefs.h 1.02/bcdefs.h
- *** 1.01/bcdefs.h Thu Feb 6 16:45:27 1992
- --- 1.02/bcdefs.h Tue Mar 3 10:29:30 1992
- ***************
- *** 2,6 ****
-
- /* This file is part of bc written for MINIX.
- ! Copyright (C) 1991 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- --- 2,6 ----
-
- /* This file is part of bc written for MINIX.
- ! Copyright (C) 1991, 1992 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- diff -c2 -r 1.01/const.h 1.02/const.h
- *** 1.01/const.h Thu Feb 6 16:45:28 1992
- --- 1.02/const.h Tue Mar 3 10:29:31 1992
- ***************
- *** 2,6 ****
-
- /* This file is part of bc written for MINIX.
- ! Copyright (C) 1991 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- --- 2,6 ----
-
- /* This file is part of bc written for MINIX.
- ! Copyright (C) 1991, 1992 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- ***************
- *** 39,43 ****
- POSIX constants. */
-
- ! #define BC_BASE_MAX 999 /* No good reason for this value. */
- #define BC_SCALE_MAX INT_MAX
- #define BC_STRING_MAX INT_MAX
- --- 39,43 ----
- POSIX constants. */
-
- ! #define BC_BASE_MAX INT_MAX
- #define BC_SCALE_MAX INT_MAX
- #define BC_STRING_MAX INT_MAX
- ***************
- *** 58,62 ****
- #define BC_LABEL_GROUP 64
- #define BC_LABEL_LOG 6
- ! #define BC_MAX_SEGS 10 /* Code segments. */
- #define BC_SEG_SIZE 1024
- #define BC_SEG_LOG 10
- --- 58,62 ----
- #define BC_LABEL_GROUP 64
- #define BC_LABEL_LOG 6
- ! #define BC_MAX_SEGS 16 /* Code segments. */
- #define BC_SEG_SIZE 1024
- #define BC_SEG_LOG 10
- diff -c2 -r 1.01/execute.c 1.02/execute.c
- *** 1.01/execute.c Thu Feb 6 16:45:38 1992
- --- 1.02/execute.c Tue Mar 3 10:29:41 1992
- ***************
- *** 2,6 ****
-
- /* This file is part of bc written for MINIX.
- ! Copyright (C) 1991 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- --- 2,6 ----
-
- /* This file is part of bc written for MINIX.
- ! Copyright (C) 1991, 1992 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- ***************
- *** 29,42 ****
- #include "bcdefs.h"
- #include <signal.h>
- - #include <setjmp.h>
- #include "global.h"
- #include "proto.h"
-
- - /* Local variable for SIGINT interrupt of an execution. */
- - static jmp_buf env;
-
- -
- /* The SIGINT interrupt handling routine. */
-
- void
- stop_execution (sig)
- --- 29,40 ----
- #include "bcdefs.h"
- #include <signal.h>
- #include "global.h"
- #include "proto.h"
-
-
- /* The SIGINT interrupt handling routine. */
-
- + int had_sigint;
- +
- void
- stop_execution (sig)
- ***************
- *** 43,49 ****
- int sig;
- {
- printf ("\n");
- rt_error ("interrupted execution");
- - longjmp (env, 1); /* Jump to the main code. */
- }
-
- --- 41,47 ----
- int sig;
- {
- + had_sigint = TRUE;
- printf ("\n");
- rt_error ("interrupted execution");
- }
-
- ***************
- *** 88,93 ****
- /* Set up the interrupt mechanism for an interactive session. */
- if (interactive)
- ! if (setjmp (env) == 0)
- signal (SIGINT, stop_execution);
-
- while (pc.pc_addr < functions[pc.pc_func].f_code_size && !runtime_error)
- --- 86,93 ----
- /* Set up the interrupt mechanism for an interactive session. */
- if (interactive)
- ! {
- signal (SIGINT, stop_execution);
- + had_sigint = FALSE;
- + }
-
- while (pc.pc_addr < functions[pc.pc_func].f_code_size && !runtime_error)
- ***************
- *** 523,530 ****
- }
-
- - /* Clean up the interrupt stuff. */
- - if (interactive)
- - signal (SIGINT, use_quit);
- -
- /* Clean up the function stack and pop all autos/parameters. */
- while (pc.pc_func != 0)
- --- 523,526 ----
- ***************
- *** 540,543 ****
- --- 536,546 ----
- while (ex_stack != NULL) pop();
-
- + /* Clean up the interrupt stuff. */
- + if (interactive)
- + {
- + signal (SIGINT, use_quit);
- + if (had_sigint)
- + printf ("Interruption completed.\n");
- + }
- }
-
- diff -c2 -r 1.01/global.c 1.02/global.c
- *** 1.01/global.c Thu Feb 6 16:45:29 1992
- --- 1.02/global.c Tue Mar 3 10:29:32 1992
- ***************
- *** 2,6 ****
-
- /* This file is part of bc written for MINIX.
- ! Copyright (C) 1991 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- --- 2,6 ----
-
- /* This file is part of bc written for MINIX.
- ! Copyright (C) 1991, 1992 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- diff -c2 -r 1.01/global.h 1.02/global.h
- *** 1.01/global.h Thu Feb 6 16:45:30 1992
- --- 1.02/global.h Tue Mar 3 10:29:33 1992
- ***************
- *** 2,6 ****
-
- /* This file is part of bc written for MINIX.
- ! Copyright (C) 1991 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- --- 2,6 ----
-
- /* This file is part of bc written for MINIX.
- ! Copyright (C) 1991, 1992 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- diff -c2 -r 1.01/libmath.b 1.02/libmath.b
- *** 1.01/libmath.b Thu Feb 6 16:45:35 1992
- --- 1.02/libmath.b Tue Mar 3 10:29:37 1992
- ***************
- *** 2,6 ****
-
- /* This file is part of bc written for MINIX.
- ! Copyright (C) 1991 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- --- 2,6 ----
-
- /* This file is part of bc written for MINIX.
- ! Copyright (C) 1991, 1992 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- diff -c2 -r 1.01/load.c 1.02/load.c
- *** 1.01/load.c Thu Feb 6 16:45:35 1992
- --- 1.02/load.c Tue Mar 3 10:29:37 1992
- ***************
- *** 2,6 ****
-
- /* This file is part of bc written for MINIX.
- ! Copyright (C) 1991 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- --- 2,6 ----
-
- /* This file is part of bc written for MINIX.
- ! Copyright (C) 1991, 1992 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- ***************
- *** 55,58 ****
- --- 55,61 ----
- int seg, offset, func;
-
- + /* If there was an error, don't continue. */
- + if (had_error) return;
- +
- /* Calculate the segment and offset. */
- seg = load_adr.pc_addr >> BC_SEG_LOG;
- ***************
- *** 60,63 ****
- --- 63,72 ----
- func = load_adr.pc_func;
-
- + if (seg >= BC_MAX_SEGS)
- + {
- + yyerror ("Function too big.");
- + return;
- + }
- +
- if (functions[func].f_body[seg] == NULL)
- functions[func].f_body[seg] = (char *) bc_malloc (BC_SEG_SIZE);
- ***************
- *** 153,156 ****
- --- 162,168 ----
- while (*str != 0)
- {
- + /* If there was an error, don't continue. */
- + if (had_error) return;
- +
- if (load_str)
- {
- ***************
- *** 249,254 ****
-
- case ']': /* A function end */
- ! if (!had_error)
- ! functions[load_adr.pc_func].f_defined = TRUE;
- load_adr = save_adr;
- break;
- --- 261,265 ----
-
- case ']': /* A function end */
- ! functions[load_adr.pc_func].f_defined = TRUE;
- load_adr = save_adr;
- break;
- diff -c2 -r 1.01/main.c 1.02/main.c
- *** 1.01/main.c Thu Feb 6 16:45:30 1992
- --- 1.02/main.c Tue Mar 3 10:29:33 1992
- ***************
- *** 2,6 ****
-
- /* This file is part of bc written for MINIX.
- ! Copyright (C) 1991 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- --- 2,6 ----
-
- /* This file is part of bc written for MINIX.
- ! Copyright (C) 1991, 1992 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- ***************
- *** 128,132 ****
-
- /* Open the other files. */
- ! if (use_math)
- {
- #ifdef BC_MATH_FILE
- --- 128,132 ----
-
- /* Open the other files. */
- ! if (use_math && first_file)
- {
- #ifdef BC_MATH_FILE
- ***************
- *** 138,142 ****
- new_yy_file (new_file);
- return TRUE;
- ! }
- else
- {
- --- 138,142 ----
- new_yy_file (new_file);
- return TRUE;
- ! }
- else
- {
- diff -c2 -r 1.01/number.c 1.02/number.c
- *** 1.01/number.c Thu Feb 6 16:45:42 1992
- --- 1.02/number.c Tue Mar 3 10:29:45 1992
- ***************
- *** 2,6 ****
-
- /* This file is part of bc written for MINIX.
- ! Copyright (C) 1991 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- --- 2,6 ----
-
- /* This file is part of bc written for MINIX.
- ! Copyright (C) 1991, 1992 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- ***************
- *** 1162,1166 ****
- int index, fdigit, pre_space;
- stk_rec *digits, *temp;
- ! bc_num int_part, frac_part, base, cur_dig, t_num;
-
- /* The negative sign if needed. */
- --- 1162,1166 ----
- int index, fdigit, pre_space;
- stk_rec *digits, *temp;
- ! bc_num int_part, frac_part, base, cur_dig, t_num, max_o_digit;
-
- /* The negative sign if needed. */
- ***************
- *** 1200,1204 ****
- --- 1200,1207 ----
- bc_sub (num, int_part, &frac_part);
- int2num (&base, o_base);
- + init_num (&max_o_digit);
- + int2num (&max_o_digit, o_base-1);
-
- +
- /* Get the digits of the integer part and push them on a stack. */
- while (!is_zero (int_part))
- ***************
- *** 1224,1228 ****
- (*out_char) (ref_str[ (int) temp->digit]);
- else
- ! out_long (temp->digit, base->n_len, 1, out_char);
- free (temp);
- }
- --- 1227,1231 ----
- (*out_char) (ref_str[ (int) temp->digit]);
- else
- ! out_long (temp->digit, max_o_digit->n_len, 1, out_char);
- free (temp);
- }
- ***************
- *** 1243,1247 ****
- (*out_char) (ref_str[fdigit]);
- else {
- ! out_long (fdigit, base->n_len, pre_space, out_char);
- pre_space = 1;
- }
- --- 1246,1250 ----
- (*out_char) (ref_str[fdigit]);
- else {
- ! out_long (fdigit, max_o_digit->n_len, pre_space, out_char);
- pre_space = 1;
- }
- diff -c2 -r 1.01/number.h 1.02/number.h
- *** 1.01/number.h Thu Feb 6 16:45:31 1992
- --- 1.02/number.h Tue Mar 3 10:29:34 1992
- ***************
- *** 2,6 ****
-
- /* This file is part of bc written for MINIX.
- ! Copyright (C) 1991 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- --- 2,6 ----
-
- /* This file is part of bc written for MINIX.
- ! Copyright (C) 1991, 1992 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- diff -c2 -r 1.01/proto.h 1.02/proto.h
- *** 1.01/proto.h Thu Feb 6 16:45:36 1992
- --- 1.02/proto.h Tue Mar 3 10:29:38 1992
- ***************
- *** 2,6 ****
-
- /* This file is part of bc written for MINIX.
- ! Copyright (C) 1991 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- --- 2,6 ----
-
- /* This file is part of bc written for MINIX.
- ! Copyright (C) 1991, 1992 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- diff -c2 -r 1.01/sbc.y 1.02/sbc.y
- *** 1.01/sbc.y Thu Feb 6 16:45:36 1992
- --- 1.02/sbc.y Tue Mar 3 10:29:38 1992
- ***************
- *** 3,7 ****
-
- /* This file is part of bc written for MINIX.
- ! Copyright (C) 1991 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- --- 3,7 ----
-
- /* This file is part of bc written for MINIX.
- ! Copyright (C) 1991, 1992 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- diff -c2 -r 1.01/scan.c.dist 1.02/scan.c.dist
- *** 1.01/scan.c.dist Thu Feb 6 16:45:44 1992
- --- 1.02/scan.c.dist Tue Mar 3 10:29:47 1992
- ***************
- *** 164,168 ****
- typedef struct yy_buffer_state *YY_BUFFER_STATE;
-
- ! #define YY_CHAR char
- # line 1 "scan.l"
- #define INITIAL 0
- --- 164,168 ----
- typedef struct yy_buffer_state *YY_BUFFER_STATE;
-
- ! #define YY_CHAR unsigned char
- # line 1 "scan.l"
- #define INITIAL 0
- ***************
- *** 171,175 ****
-
- /* This file is part of bc written for MINIX.
- ! Copyright (C) 1991 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- --- 171,175 ----
-
- /* This file is part of bc written for MINIX.
- ! Copyright (C) 1991, 1992 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- ***************
- *** 330,334 ****
- } ;
-
- ! static const YY_CHAR yy_ec[128] =
- { 0,
- 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
- --- 330,334 ----
- } ;
-
- ! static const YY_CHAR yy_ec[256] =
- { 0,
- 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
- ***************
- *** 345,349 ****
- 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
- 41, 42, 43, 44, 45, 46, 47, 36, 48, 36,
- ! 49, 36, 50, 51, 52, 1, 1
- } ;
-
- --- 345,363 ----
- 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
- 41, 42, 43, 44, 45, 46, 47, 36, 48, 36,
- ! 49, 36, 50, 51, 52, 1, 1, 1, 1, 1,
- ! 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- ! 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- ! 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- ! 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- ! 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- ! 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- ! 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- !
- ! 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- ! 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- ! 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- ! 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- ! 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- ! 1, 1, 1, 1, 1
- } ;
-
- ***************
- *** 761,768 ****
- # line 130 "scan.l"
- {
- ! char *look;
- yylval.s_value = strcopyof(yytext);
- for (look = yytext; *look != 0; look++)
- ! if (*look == '\n') line_no++;
- return(STRING);
- }
- --- 775,787 ----
- # line 130 "scan.l"
- {
- ! unsigned char *look;
- ! int count = 0;
- yylval.s_value = strcopyof(yytext);
- for (look = yytext; *look != 0; look++)
- ! {
- ! if (*look == '\n') line_no++;
- ! if (*look == '"') count++;
- ! }
- ! if (count != 2) yyerror ("NUL character in string.");
- return(STRING);
- }
- ***************
- *** 769,775 ****
- YY_BREAK
- case 37:
- ! # line 137 "scan.l"
- {
- ! char *src, *dst;
- int len;
- /* remove a trailing decimal point. */
- --- 788,794 ----
- YY_BREAK
- case 37:
- ! # line 142 "scan.l"
- {
- ! unsigned char *src, *dst;
- int len;
- /* remove a trailing decimal point. */
- ***************
- *** 799,807 ****
- YY_BREAK
- case 38:
- ! # line 164 "scan.l"
- ! yyerror ("illegal character: %s",yytext);
- YY_BREAK
- case 39:
- ! # line 165 "scan.l"
- ECHO;
- YY_BREAK
- --- 818,834 ----
- YY_BREAK
- case 38:
- ! # line 169 "scan.l"
- ! {
- ! if (yytext[0] < ' ')
- ! yyerror ("illegal character: ^%c",yytext[0] + '@');
- ! else
- ! if (yytext[0] > '~')
- ! yyerror ("illegal character: \\%3d", (int) yytext[0]);
- ! else
- ! yyerror ("illegal character: %s",yytext);
- ! }
- YY_BREAK
- case 39:
- ! # line 178 "scan.l"
- ECHO;
- YY_BREAK
- ***************
- *** 1073,1077 ****
- }
- yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
- ! yy_is_jam = (yy_base[yy_current_state] == 194);
-
- return ( yy_is_jam ? 0 : yy_current_state );
- --- 1100,1104 ----
- }
- yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
- ! yy_is_jam = (yy_current_state == 143);
-
- return ( yy_is_jam ? 0 : yy_current_state );
- ***************
- *** 1327,1331 ****
- b->yy_eof_status = EOF_NOT_SEEN;
- }
- ! # line 165 "scan.l"
-
-
- --- 1354,1358 ----
- b->yy_eof_status = EOF_NOT_SEEN;
- }
- ! # line 178 "scan.l"
-
-
- diff -c2 -r 1.01/scan.l 1.02/scan.l
- *** 1.01/scan.l Thu Feb 6 16:45:31 1992
- --- 1.02/scan.l Tue Mar 3 10:29:39 1992
- ***************
- *** 3,7 ****
-
- /* This file is part of bc written for MINIX.
- ! Copyright (C) 1991 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- --- 3,7 ----
-
- /* This file is part of bc written for MINIX.
- ! Copyright (C) 1991, 1992 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- ***************
- *** 129,140 ****
- [a-z][a-z0-9_]* { yylval.s_value = strcopyof(yytext); return(NAME); }
- \"[^\"]*\" {
- ! char *look;
- yylval.s_value = strcopyof(yytext);
- for (look = yytext; *look != 0; look++)
- ! if (*look == '\n') line_no++;
- return(STRING);
- }
- {DIGIT}({DIGIT}|\\\n)*("."({DIGIT}|\\\n)*)?|"."(\\\n)*{DIGIT}({DIGIT}|\\\n)* {
- ! char *src, *dst;
- int len;
- /* remove a trailing decimal point. */
- --- 129,145 ----
- [a-z][a-z0-9_]* { yylval.s_value = strcopyof(yytext); return(NAME); }
- \"[^\"]*\" {
- ! unsigned char *look;
- ! int count = 0;
- yylval.s_value = strcopyof(yytext);
- for (look = yytext; *look != 0; look++)
- ! {
- ! if (*look == '\n') line_no++;
- ! if (*look == '"') count++;
- ! }
- ! if (count != 2) yyerror ("NUL character in string.");
- return(STRING);
- }
- {DIGIT}({DIGIT}|\\\n)*("."({DIGIT}|\\\n)*)?|"."(\\\n)*{DIGIT}({DIGIT}|\\\n)* {
- ! unsigned char *src, *dst;
- int len;
- /* remove a trailing decimal point. */
- ***************
- *** 162,166 ****
- return(NUMBER);
- }
- ! . yyerror ("illegal character: %s",yytext);
- %%
-
- --- 167,179 ----
- return(NUMBER);
- }
- ! . {
- ! if (yytext[0] < ' ')
- ! yyerror ("illegal character: ^%c",yytext[0] + '@');
- ! else
- ! if (yytext[0] > '~')
- ! yyerror ("illegal character: \\%3d", (int) yytext[0]);
- ! else
- ! yyerror ("illegal character: %s",yytext);
- ! }
- %%
-
- diff -c2 -r 1.01/storage.c 1.02/storage.c
- *** 1.01/storage.c Thu Feb 6 16:45:41 1992
- --- 1.02/storage.c Tue Mar 3 10:29:44 1992
- ***************
- *** 2,6 ****
-
- /* This file is part of bc written for MINIX.
- ! Copyright (C) 1991 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- --- 2,6 ----
-
- /* This file is part of bc written for MINIX.
- ! Copyright (C) 1991, 1992 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- diff -c2 -r 1.01/util.c 1.02/util.c
- *** 1.01/util.c Thu Feb 6 16:45:39 1992
- --- 1.02/util.c Tue Mar 3 10:29:42 1992
- ***************
- *** 2,6 ****
-
- /* This file is part of bc written for MINIX.
- ! Copyright (C) 1991 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- --- 2,6 ----
-
- /* This file is part of bc written for MINIX.
- ! Copyright (C) 1991, 1992 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- diff -c2 -r 1.01/version.h 1.02/version.h
- *** 1.01/version.h Thu Feb 6 16:45:32 1992
- --- 1.02/version.h Tue Mar 3 10:29:34 1992
- ***************
- *** 1,3 ****
- #define BC_VERSION \
- ! "bc 1.01 (Nov 25, 1991), Copyright (C) 1991 Free Software Foundation, Inc."
-
- --- 1,3 ----
- #define BC_VERSION \
- ! "bc 1.02 (Mar 3, 92) Copyright (C) 1991, 1992 Free Software Foundation, Inc."
-
- exit 0 # Just in case...
-